598d9a
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2016 the original author or authors.
+ * Copyright 2002-2017 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
package org.springframework.web.filter;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintWriter;
+
 import javax.servlet.FilterChain;
 import javax.servlet.ServletException;
 import javax.servlet.ServletOutputStream;
@@ -168,8 +169,8 @@
public class ShallowEtagHeaderFilter extends OncePerRequestFilter {
 			int responseStatusCode, InputStream inputStream) {
 
 		String method = request.getMethod();
-		if (responseStatusCode >= 200 && responseStatusCode < 300 &&
-				(HttpMethod.GET.matches(method) || HttpMethod.HEAD.matches(method))) {
+		if (responseStatusCode >= 200 && responseStatusCode < 300
+				&& HttpMethod.GET.matches(method)) {
 
 			String cacheControl = response.getHeader(HEADER_CACHE_CONTROL);
 			if (cacheControl == null || !cacheControl.contains(DIRECTIVE_NO_STORE)) {
